{% extends "codeflow/reviewer/base.html" %}
{% block content %}
<h1>Inbox</h2>
<div class="section">
  <h2>Reviews of my changesets</h2>
  <table class="fancy" width="100%">
    <thead>
      <tr>
        <th width="10%"> Who </th>
        <th width="40%"> Changeset </th>
        <th width="40%"> Review </th>
        <th width="10%"> Status </th>
      </tr>
    </thead>
    <tbody>
      {% for cset_review in reviews_of_user_changesets %}
      <tr class="{% cycle odd,even %}">
        <td> {{ cset_review.review.author }} </td>
        <td> {{ cset_review.changeset|truncatewords:10 }} </td>
        <td>
          <a href="/review/{{cset_review.review.id}}/">{{ cset_review.review }}
          </a>: {{ cset_review.first_comment.text|truncatewords:10 }}
        </td>
        <td>
          {% if cset_review.review.passed %}
          <img src="/media/icons/review_passed.png">
          {% endif %}
          {% if cset_review.review.failed %}
          <img src="/media/icons/review_failed.png">
          {% endif %}
          {{ cset_review.review.status }}
        </td>
      </tr>
      {% endfor %}
    </tbody>
  </table>
</div>
<div class="section">
  <h2>My Reviews of other's changesets</h2>
  <table class="fancy" width="100%">
    <thead>
      <tr>
        <th width="10%"> Who  </th>
        <th width="40%"> Changeset </th>
        <th width="40%"> Review </th>
        <th width="10%"> Status </th>
      </tr>
    </thead>
    <tbody>
      {% for cset_review in changeset_reviews_by_the_user %}
      <tr class="{% cycle odd,even %}">
        <td> {{ cset_review.changeset.scm_user.user }} </td>
        <td> {{ cset_review.changeset|truncatewords:10 }} </td>
        <td>
          <a href="/review/{{cset_review.review.id}}/">{{ cset_review.review }}
          </a>: {{ cset_review.first_comment.text|truncatewords:10 }}
        </td>
        <td>
          {% if cset_review.review.passed %}
          <img src="/media/icons/review_passed.png">
          {% endif %}
          {% if cset_review.review.failed %}
          <img src="/media/icons/review_failed.png">
          {% endif %}
          {{ cset_review.review.status }}
        </td>
      </tr>
      {% endfor %}
    </tbody>
  </table>
</div>
{% endblock %}
